package com.example.ssm1023.controller;

import com.example.ssm1023.config.AppResult;
import com.example.ssm1023.exception.ApplicationException;
import com.example.ssm1023.model.User;
import com.example.ssm1023.service.IUserService;
import lombok.NonNull;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("/user")
public class UserController {

    @Autowired
    private IUserService userService;

    @RequestMapping("/login")
    public AppResult login(@NonNull String username,
                           @NonNull String password) {
        //1.用户登录
        User user = userService.login(username, password);
        return AppResult.success();
    }


}
